-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Directly start foreground service #7340
Conversation
@tobiasKaminsky this is very strange edge case as video player does not use PlayerService at all - it depends on a media player in VideoView. It sounds to me like the player service might be receiving unintended events from GUI. |
Tried it, it does not seem to crash, but I think crashing for me is caused by autoupload, which doesn't seem to want to start on this app. I did turn off doze for it. Maybe it needs a bit of time... |
Ok, autoupload started working, it took a while to initialize and well... The problem is fixed. The problem being the app crash, now the app doesn't crash but instead the whole app or Android system freezes and/or ANR dialogue is shown. This fixed one of the symptoms apparently. Looks like the underlying problem was just exacerbating the crash case, I did not know there was an underlying problem in the first place. Okay, so the problem for me is app freezing. P.S. Can't even open the app anymore - it stops responding on the initial loading screen. |
I was confused by that first, too. PreviewMediaFragment then can do both: play audio or video. When you then click on video in PreviewMediaFragment it opens up PreviewVideoActivity to display video in fullscreen… |
Reason why PlayerService is started is: android/src/main/java/com/owncloud/android/ui/preview/PreviewMediaFragment.java Lines 326 to 329 in 77751da
Which is somehow needed:
|
41dcb04
to
8f17962
Compare
@InfamousUser can you test it again, please? |
@ezaquarii I found the cause and hopefully a proper fix. Can you review it? :-) |
master-light-blue-Screenshot test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/16785-Screenshot-master-light-blue |
stable-light-blue-Screenshot test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/16785-Screenshot-stable-light-blue |
master-dark-blue-Screenshot test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/16785-Screenshot-master-dark-blue |
stable-dark-blue-Screenshot test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/16785-Screenshot-stable-dark-blue |
Probably same as above, I can't test because of the original problem. The app is frozen solid on startup for 80 seconds (loading screen), then displays frozen main interface. It also locks the Android interface half the times for up to half a minute, that shouldn't be possible, probably a bug in Android. |
Can you create another issue for this? |
/backport to stable-3.14 |
Not sure whether you wanted the log here or in the new issue, but here it is here just in case. Also not sure this is what you mean by logcat, never used it before, this is what I got by finding an app called that. |
New issue: #7378 |
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
1af8e41
to
343561a
Compare
❗ Rebased ❗ |
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/7340.apk |
1 similar comment
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/7340.apk |
master-Unit test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/16857-Unit-master-08-45 |
Codecov Report
@@ Coverage Diff @@
## master #7340 +/- ##
============================================
- Coverage 29.13% 29.10% -0.04%
Complexity 5 5
============================================
Files 442 442
Lines 34823 34840 +17
Branches 4817 4824 +7
============================================
- Hits 10147 10140 -7
- Misses 23182 23206 +24
Partials 1494 1494
|
CodacyLint
SpotBugs (new)
SpotBugs (master)
|
stable-IT test failed: https://www.kaminsky.me/nc-dev/android-integrationTests/16857-IT-stable-09-08 |
Directly start foreground service Signed-off-by: thelittlefireman <thelittlefireman@users.noreply.github.com>
Fix #2010
Fix #6905
This is not done at all, but it prevents from crashing on my test device.
@ezaquarii for some reason the startForeground in PlayerService is not called, when starting a video.
Thus it get killed by Android after a specific time.
Signed-off-by: tobiasKaminsky tobias@kaminsky.me
Testing
Writing tests is very important. Please try to write some tests for your PR.
If you need help, please do not hesitate to ask in this PR for help.
unit tests
instrumented tests
UI tests